import 'package:flutter_test/flutter_test.dart';
import 'package:take_photo/take_photo.dart';
import 'package:take_photo/take_photo_platform_interface.dart';
import 'package:take_photo/take_photo_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockTakePhotoPlatform
    with MockPlatformInterfaceMixin
    implements TakePhotoPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final TakePhotoPlatform initialPlatform = TakePhotoPlatform.instance;

  test('$MethodChannelTakePhoto is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelTakePhoto>());
  });

  test('getPlatformVersion', () async {
    TakePhoto takePhotoPlugin = TakePhoto();
    MockTakePhotoPlatform fakePlatform = MockTakePhotoPlatform();
    TakePhotoPlatform.instance = fakePlatform;

    expect(await takePhotoPlugin.getPlatformVersion(), '42');
  });
}
